<template>
  <view class="m-bbb">
    <view
      class="item dev-box label1"
      v-for="(item, index) in positions"
      :key="index"
      @click="onClick(item)"
	  >
	  
      <view class="mark" v-if="listType == 1">{{
        item.type == 0 ? '进行中' : item.status == 1 ? '已取消' : '已结束'
      }}</view>
      <view class="mark" v-else>{{ item.bangbTypes }}</view>

      <view class="title space-between">
        <view class="left">
         标题 ：  <text class="title-name">{{ item.title }}</text>
        </view>
        <text class="right">{{ item.money + '星币' }}</text>
      </view>
      <view>
        状态：
        <text
          :class="{
            'text-error': item.urgent === '1',
          }"
          >{{ item.urgent === '1' ? '加急' : '正常' }}</text
        >
      </view>
      <view class="dateTime">
        <uni-icons type="calendar" style="margin-right: 15upx"></uni-icons>
        发布时间：{{ formatCreateTime(item.createTime) }}
      </view>
      <view class="dateTime">
        <uni-icons type="calendar" style="margin-right: 15upx"></uni-icons>
        截止时间： {{ formatCreateTime(item.endTime) }}
      </view>
	  
      <view class="label">
        <text class="title-parttime">{{ item.mode }}</text>
      </view>
	 
    </view>
	<!-- <view >
	  <image click="" class="img" src="../../static/icon/add.png"></text>
	  
	</view> -->
  </view>
</template>

<script>
import mEmptyData from '@/components/m-empty-data/m-empty-data.vue';
import { formatDate } from '@/common/date';
export default {
  name: 'yzb-position',
  props: {
    positions: Array,
    listType: Number,
    isAuth: Boolean,
  },
  components: {
    mEmptyData,
  },
  data() {
    moneyShow: false;
    return {
      no_order_1: this.$mAssetsPath.no_order_1,
    };
  },

  methods: {
    onClick(item) {
      this.$emit('click', item);
    },
    formatCreateTime(time) {
      if (time == null || time === '') {
        return '未知';
      }
      let str = time.replace(/-/g, '/');
      let date = new Date(str);
      return formatDate(date, 'yyyy.MM.dd');
    },
  },
};
</script>

<style lang="scss">
.m-bbb {
  .mark {
    color: white;
    font-size: 35upx;
    line-height: 80upx;
    width: 180upx;
    text-align: center;
	 transform: translateX(-10px);
  }
  .img {
		    position: fixed;
		    bottom: 0;
		    left: 50%;
		    transform: translateX(-50%);
		    width: 50px;
		    height: 50px;
	
  }
  
  .label1 {
    background-image: url(https://cmtq-1317574530.cos.ap-guangzhou.myqcloud.com/img2023/img/label1.png);
  }
  .label2 {
    background-image: url(https://cmtq-1317574530.cos.ap-guangzhou.myqcloud.com/img2023/img/label2.png);
  }
  .label3 {
    background-image: url(https://cmtq-1317574530.cos.ap-guangzhou.myqcloud.com/img2023/img/label3.png);
  }
  .item {
    background-size: 200upx 90upx;
    background-repeat: no-repeat;
    background-color: $bgcolor_white;
    padding: 0upx 30upx 30upx 30upx;
  }
}
.text-error {
  color: #cb2e2e;
}
.space-between {
  display: flex;
  justify-content: space-between;
  flex-direction: row;
}
.distance {
  float: right;
  color: #666;
}
.label {
  height: 40upx;
  width: 100%;
  margin-top: 8upx;
  // border-radius: 6upx; /* 添加圆角 */
  .title-parttime {
	font-size: 35upx; //字体大小
    color: #66666e;
    border: 1upx solid #36b957;
    background-color: #f5ffe6;
   // font-size: $uni-font-size-sm;
    margin-right: 15upx;
    padding: 4upx 15upx;
    border-radius: 6upx;
    line-height: 40upx;
    float: left;
	border-radius: 15upx; /* 添加圆角 */
  }
}

.title {
  margin-top: 10upx;
  .title-name {
		
    font-weight: bold;
    font-size: $uni-font-size-lg;
  }
  .right {
    color: #cb2e2e;
    font-weight: bold;
    font-size: 32upx;
  }
}
</style>
